package com.kly.user.dto;

import java.io.Serializable;

public class UserMsgDto implements Serializable {
    private Long id;
    /**
     *消息主键
     */
    private String msgId;
    /**
     *发送用户
     */
    private String fromUserCode;
    /**
     *接收用户
     */
    private String toUserCode;
    /**
     *文字消息-1, 图片消息-2, GIF图片消息-3, 图文消息-4, 文件消息-5, 位置消息-6, 小视频消息-7, 引用消息-8, 合并转发消息-9
     */
    private String msgType;
    /**
     *消息内容
     */
    private String content;

    /**
     * 来源
     */
    private String source;

    private Integer msgNum;

    public Integer getMsgNum() {
        return msgNum;
    }

    public void setMsgNum(Integer msgNum) {
        this.msgNum = msgNum;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getFromUserCode() {
        return fromUserCode;
    }

    public void setFromUserCode(String fromUserCode) {
        this.fromUserCode = fromUserCode;
    }

    public String getToUserCode() {
        return toUserCode;
    }

    public void setToUserCode(String toUserCode) {
        this.toUserCode = toUserCode;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public static UserMsgDto toDto(String fromUserCode, String toUserCode, Integer msgNum) {
        UserMsgDto dto = new UserMsgDto();
        dto.setFromUserCode(fromUserCode);
        dto.setToUserCode(toUserCode);
        dto.setMsgNum(msgNum == null ? 0 : msgNum);
        return dto;
    }
}
